package com.msb.api.feign.product;

import com.msb.common.vo.CommonResult;
import com.msb.mall.core.entity.product.SkuInfoEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@FeignClient(
        name = "mall-product", path = "/mall-product"
)
public interface ProductFeignApi {

    @PostMapping(value = "/product/brand/findAll")
    CommonResult findAll(@RequestBody Map<String, Object> params);

    /**
     * 当然我们也可以通过网关来调用商品服务
     * @param skuId
     * @return
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    CommonResult<SkuInfoEntity> info(@PathVariable("skuId") Long skuId);
}
